/* 深色主题样式 */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --border-color: #444444;
    --accent-color: #4facfe;
    --card-bg: #2d2d2d;
    --input-bg: #3d3d3d;
    --input-border: #555555;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e9ecef;
    --accent-color: #007bff;
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --input-border: #e9ecef;
}

/* 应用主题变量 */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 侧边栏深色主题适配 */
[data-theme="dark"] .sidebar {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

[data-theme="dark"] .sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .sidebar-btn.active {
    background: rgba(79, 172, 254, 0.25);
    border-left: 3px solid var(--accent-color);
}

/* 侧边栏图标深色主题适配 */
[data-theme="dark"] .btn-icon {
    filter: brightness(1.5);
}

[data-theme="dark"] .sidebar-btn:hover .btn-icon {
    filter: brightness(2);
}

[data-theme="dark"] .sidebar-btn.active .btn-icon {
    filter: brightness(2.5);
}

/* 主内容区域深色主题适配 */
[data-theme="dark"] .container {
    background: var(--bg-secondary);
}

[data-theme="dark"] header {
    background: linear-gradient(135deg, #2d527a 0%, #1e3a5f 100%);
}

[data-theme="dark"] .search-section {
    background: var(--bg-secondary);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .input-group input {
    background: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-primary);
}

[data-theme="dark"] .content {
    background: var(--bg-primary);
}

[data-theme="dark"] .material-info,
[data-theme="dark"] .info-section,
[data-theme="dark"] .visualization,
[data-theme="dark"] .papers-section,
[data-theme="dark"] .prices-section {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .info-section h3,
[data-theme="dark"] .visualization h3,
[data-theme="dark"] .papers-section h3,
[data-theme="dark"] .prices-section h3 {
    color: var(--text-primary);
    filter: brightness(1.5);
}

[data-theme="dark"] .info-section p,
[data-theme="dark"] .paper-abstract,
[data-theme="dark"] .price-abstract {
    color: var(--text-secondary);
}

[data-theme="dark"] .welcome {
    color: var(--text-secondary);
}

[data-theme="dark"] .api-note {
    background: rgba(79, 172, 254, 0.1);
    border-left-color: var(--accent-color);
}

/* AI聊天深色主题适配 */
[data-theme="dark"] .ai-chat {
    background: var(--bg-primary);
}

[data-theme="dark"] .chat-header {
    background: linear-gradient(135deg, #2d527a 0%, #1e3a5f 100%);
}

[data-theme="dark"] .chat-messages {
    background: var(--bg-secondary);
}

[data-theme="dark"] .message-text {
    background: var(--card-bg);
    color: var(--text-primary);
}

[data-theme="dark"] .message.user .message-text {
    background: var(--accent-color);
    color: white;
}

[data-theme="dark"] .chat-input {
    background: var(--bg-primary);
    border-top-color: var(--border-color);
}

[data-theme="dark"] .input-group input {
    background: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-primary);
}

[data-theme="dark"] .suggestion-btn {
    background: var(--input-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .suggestion-btn:hover:not(:disabled) {
    background: var(--border-color);
}

/* 设置页面深色主题适配 */
[data-theme="dark"] .settings {
    background: var(--bg-primary);
}

[data-theme="dark"] .settings-header {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .settings-section {
    background: var(--bg-secondary);
}

[data-theme="dark"] .setting-item input,
[data-theme="dark"] .setting-item select,
[data-theme="dark"] .setting-item textarea {
    background: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-primary);
}

[data-theme="dark"] .settings-actions {
    border-top-color: var(--border-color);
}

/* 设置页面图标深色主题适配 */
[data-theme="dark"] .settings-header h3,
[data-theme="dark"] .settings-section h4 {
    filter: brightness(1.5);
}

/* 账户信息深色主题适配 */
[data-theme="dark"] .account-info {
    background: var(--bg-primary);
}

[data-theme="dark"] .account-header {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .user-card {
    background: linear-gradient(135deg, #2d527a 0%, #1e3a5f 100%);
}

[data-theme="dark"] .settings-section,
[data-theme="dark"] .usage-stats,
[data-theme="dark"] .account-actions,
[data-theme="dark"] .system-info {
    background: var(--bg-secondary);
}

[data-theme="dark"] .stat-card,
[data-theme="dark"] .info-item {
    background: var(--card-bg);
}

/* 账户信息页面图标深色主题适配 */
[data-theme="dark"] .stat-icon {
    filter: brightness(1.5);
}

[data-theme="dark"] .account-info h3,
[data-theme="dark"] .settings-section h4,
[data-theme="dark"] .usage-stats h4,
[data-theme="dark"] .account-actions h4,
[data-theme="dark"] .system-info h4 {
    filter: brightness(1.5);
}

/* 保存/加载深色主题适配 */
[data-theme="dark"] .save-load {
    background: var(--bg-primary);
}

[data-theme="dark"] .save-load-header {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .option-group input[type="text"] {
    background: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-primary);
}

[data-theme="dark"] .preview-section {
    background: var(--bg-secondary);
}

[data-theme="dark"] .recent-file-item {
    background: var(--bg-secondary);
}

[data-theme="dark"] .recent-file-item:hover {
    background: var(--border-color);
}